<?php

namespace app\common\service;


use app\common\model\CombineGoods;
use app\common\model\Goods;

/**
 * 下单组合服务
 *
 * Class CombineService
 * @package app\common\service
 */
class CombineService {


    /**
     * 获取组合下的商品
     *
     * @param $combine_id
     * @return \think\Collection|\think\Model[]
     */
    public static function getCombineGoods ($combine_id) {

        $list = CombineGoods::where('combine_id', $combine_id)->field('*,goods_name as name')->select();
        return $list;
    }


    /**
     * 获取所有商品列表
     */
    public static function getGoods(){

        $goods_list = Goods::field('id,name')->select()->toArray();

        return $goods_list;
    }



}
